Network forwarding elements, such as switches and routers, have control and data plane components. The data plane component includes several message processing stages that handle the forwarding of the data packets that the forwarding element receives. The control plane component provides an interface for configuring the data plane component.
The data plane includes a parser that extracts different fields from the header of received data messages. The extracted header fields are stored in a set of registers (or containers) in a format, which can be modified by successive message processing stages of the forwarding element as part of their message processing operations.
The data plane includes a limited number of packet header containers that can be divided into a set of container fields to store different header fields of a message. The data plane also includes a limited number of arithmetic logic units that are used to perform different actions on the header fields of data messages during different message processing stages. It is desirable to configure the message processing stages of the forwarding elements to optimize the use of the container fields and the arithmetic logic units.